package chapter5.java1;

import java.io.FileReader;
import java.io.IOError;
import java.io.IOException;
import java.util.Date;

/**
 * @Author juzipi
 * @Date 2021/5/17 15:43
 * @Info
 */
public class ReturnAddress {

    public boolean methodBoolean(){
        return false;
    }

    public byte methodByte(){
        return 0;
    }

    public short methodShort(){
        return 0;
    }

    public char methodChar(){
        return 'a';
    }

    public int methodInt(){
        return 0;
    }

    public long methodLong(){
        return 1L;
    }

    public float methodFloat(){
        return 1.1f;
    }

    public double methodDouble(){
        return 1.2d;
    }

    public Date methodDate(){
        return null;
    }

    public String methodString(){
        return "饮茶啦";
    }

    public void methodVoid(){

    }

    static {
        int i = 10;
    }

    public void method2(){

        methodVoid();

        try {
            method1();
        } catch (IOException e){
            e.printStackTrace();
        }
    }

    public void method1() throws IOException {
        FileReader fileReader = new FileReader("guigu.txt");
        char[] chars = new char[1024];
        int len;
        while ((len = fileReader.read(chars)) != -1){
            String s = new String(chars,0,len);
            System.out.println(s);
        }
        fileReader.close();

    }



}
